import { createStore } from 'vuex'
import createPersistedstate from 'vuex-persistedstate'

// 三个独立模块
import cart from './modules/cart.js'
import user from './modules/user.js'
import category from './modules/category.js'

export default createStore({
    state: {},
    getters: {},
    mutations: {},
    actions: {},
    modules: {
        cart,
        user,
        category
    },
    plugins: [
        createPersistedstate({
            // 本地存储的名字
            key: 'erabbit-client-pc-124-store',
            //指定需要存储的模块	
            paths: ['user', 'cart']
        })
    ]

})